/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.Toto.srp.srp_violating.service.internal;

import za.ac.cput.Toto.srp.obeying.model.Bricks;
import za.ac.cput.Toto.srp.obeying.service.Block;

/**
 *
 * @author 210012285
 */
public class BrickTransactions implements Block{

   

    public void purchase(Bricks bricks, int qty) {
        
       int total = 0;
       
       if(bricks.getBriksOnHand() < qty)
           
           System.out.println("Item is out of stock");
         
           else
       {
           bricks.setQty(qty);
           total += bricks.getPrice()* bricks.getQty();
       }
       
       
       
       
       
        
    }
 public int calBricksOnHand(Bricks bricks) {
       
        
          return bricks.getBriksOnHand() - bricks.getQty();
        
    }
 public double calcTax(Bricks brick)
 {
 
      double tax;
        
        tax = brick.getSalary() - (brick.getSalary() * 0.14);
        
        return tax;
 
 }
  
    
}
